import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:mall/modules/sc/client_sc.dart';
import 'package:mall/ui/page/guide/guide_page.dart';
import 'package:mall/ui/page/home/home_page.dart';

class MainPage extends StatefulWidget {
  @override
  _MainPageState createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  final sc_client = Get.put(ClientSc());

  @override
  Widget build(BuildContext context) {
    // ScreenUtil.init(context,
    //     width: AppDimens.MAX_WIDTH,
    //     height: AppDimens.MAX_HEIGHT,
    //     allowFontScaling: false);
    // return ClientService.isFirst
    //     ? GuidePage()
    //     : HomePage();
    return Obx(() {
      if (sc_client.data.value == null) {
        return const SizedBox();
      }
      if (sc_client.data.value!.isFirst) {
        return GuidePage();
      }
      return HomePage();
    });
  }
}
